<template>
  <div>
    <input type="text" ref="name" @keyup.enter="add">
  </div>
</template>

<script>
import {mapMutations} from 'vuex'
export default {
  methods: {
    ...mapMutations(['addTodo']),
    add() {
      let val = this.$refs.name.value
      // this.$store.commit('addTodo',val)
      this.addTodo(val);
    }
  }
}
</script>

